var isOpen = "0"; // 1 or 0; 1 is open ; 0 is close
var open = document.getElementsByTagName('input')[0];
var close = document.getElementsByTagName('input')[1];

chrome.storage.sync.get("open", function(items) {
    isOpen = items.open + "";
    if(isOpen == "1") {
        open.checked = true;
    }else {
        close.checked = true;
    }
});



open.onclick = function() {
    chrome.runtime.sendMessage({type:"open", i:"1"});
};

close.onclick = function() {
    chrome.runtime.sendMessage({type:"open", i:"0"});
};